Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: eip-7702 support in aa-sdk/core, and sma7702 support in account-kit/smart-contracts #1287

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

adamegyed
Copy link
Collaborator

@adamegyed adamegyed commented Jan 23, 2025

Pull Request Checklist


PR-Codex overview

This PR primarily updates the viem dependency version across multiple packages and introduces new functionality related to ModularAccountV2, including its creation, client handling, and error management.

Detailed summary

  • Updated viem from ^2.20.0 to ^2.22.6 in several package.json files.
  • Added support for ModularAccountV2 in account creation and client functions.
  • Introduced InvalidModularAccountV2Mode error class.
  • Enhanced signAuthorization method in LocalAccountSigner.
  • Updated documentation and references for ModularAccountV2 methods.
  • Added new utility functions and middleware for EIP-7702 compatibility.

The following files were skipped due to too many changes: account-kit/smart-contracts/src/ma-v2/client/client.ts, account-kit/smart-contracts/src/ma-v2/account/semiModularAccountV2.ts, yarn.lock

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 8, 2025 0:12am
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 8, 2025 0:12am

Copy link

graphite-app bot commented Jan 23, 2025

How to use the Graphite Merge Queue

Add the label graphite-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Collaborator

@moldy530 moldy530 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is looking good!

One thing missing is some client.test at a minimum (though would be great if we could extend it to installValidation.ts and have unit tests for installValidation.test.ts)

OOS for this PR is the naming I think, but calling it out here as @howydev and @linnall look at consolidating to the Prism naming as just looking at this PR it's clear that it'll be much better devex externally to have both a Prism account factory and Prism client factory for release

aa-sdk/core/src/middleware/defaults/7702gasEstimator.ts Outdated Show resolved Hide resolved
aa-sdk/core/src/middleware/defaults/7702signer.ts Outdated Show resolved Hide resolved
aa-sdk/core/src/middleware/defaults/7702signer.ts Outdated Show resolved Hide resolved

export type MAV2Account<
TSigner extends SmartAccountSigner = SmartAccountSigner
> = SmartContractAccountWithSigner<"MAV2Account", TSigner, "0.7.0"> & {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this base type should probably be generic on source as well since source should be unique per instance (ie. the first generic parameter in SmartContractAccountWithSigner)

Comment on lines 28 to 24
signer: TSigner;
entryPoint?: EntryPointDef<"0.7.0", Chain>;
signerEntity?: SignerEntity;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yea I remember seeing this during hackathon and thinking it odd. Why can't we merge signer and signerEntity?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

account-kit/smart-contracts/src/ma-v2/client/sma7702.ts Outdated Show resolved Hide resolved
linnall and others added 20 commits February 7, 2025 16:35
* feat: adds initial impl of signAuthorization

* docs: adds signAuthorization documentation

* fix: rename var
* feat: add unified ma v2 client

* chore: update docs

* chore: make account source unique
* feat: add unified ma v2 client

* chore: make account source unique

* feat: add ma v2 account to use smart contract client hook

* chore: remove different type names

* chore: rename mav2 to ModularAccountV2

* fix: review fix, add common type

* fix: typo

* fix: remove await

* fix: narrow the type instead of doing non null assertion
* fix: rename MAv2 type to mode, add 7702 middleware for react hook

* fix: don't switch MintCard to MAv2 yet

* fix: reconnect 7702 account after page refresh

* chore: remove comment

* docs: regen docs

* fix: fix docs

* fix: remove unnecessary optional chaining
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants